<template>
	<div  >
		<!-- <div class="header"><a-icon type="left" class='left'/>{{baseform.name}}</div> -->
		<titleCommon :title='baseform.name'></titleCommon>
		<a-spin  :spinning="spinning"  :indicator="indicator">
			<div class='contain mt15'>
				<div class='contain-main border-b-1 ' style="padding-left: 0.1rem">
					<ul class='table_div' style="margin-top: 0">
						<li> <span class='color-yellow'>{{baseform.prjSize | Num_splitby_thresscomma}}</span> <br> <span class='ft12 color-999'>规模（万）</span> </li>
						<li> <span class='color-yellow ft12'>{{baseform.type | propertyType}}</span>          <br> <span class='ft12 color-999'>资产类型</span> </li>
						<li> <span class='ft12'>{{baseform.issuer}}</span>    								 <br> <span class='ft12 color-999'>发行方 </span> </li>
						<li> <span class='ft12'>{{baseform.subsistingCycle}}个月</span>                                   		 <br> <span class='ft12 color-999'>存续周期</span> </li>  
					</ul> 
				</div> 
			</div>
			<dl class='contain mt15'> 
				<dt class="contain-title border-b-1"><span>基本信息</span></dt>
				<div class='contain-main ft12 lh-200'>
					<dd> <label> 资产名称 </label> 		{{baseform.name}} </dd>
					<dd> <label> 项目类型 </label> 		{{baseform.type | propertyType}} </dd>
					<dd> <label> 项目规模（万）</label> 	{{baseform.prjSize |Num_splitby_thresscomma}} </dd>
					<dd> <label> 融资主体性质 </label> 	{{baseform.financingSubjectNature |financingSubjectNature}} </dd>
					<dd> <label> 所属集团</label> 	    {{baseform.affiliatedGroup}} </dd>
					<dd> <label> 存续周期 </label> 		{{baseform.subsistingCycle}}个月 </dd>
					<dd> <label> 期望募集周期 </label> 	{{baseform.expectRecruitmentCycle}} </dd>
					<dd> <label> 募集路径 </label> 		{{baseform.collectionAmtType}} </dd>
					<dd> <label> 发行方 </label> 		{{baseform.issuer }} </dd>
					<dd> <label> 增信方 </label> 		{{baseform.increasingCredit ||  '--'}} </dd>
					<dd> <label> 期望募集开始日期 </label>{{baseform.expectStartDate | formatDates}}
			  		</dd>
					 
				</div>
			</dl>
			 
			<div class='contain mt15'  v-if='baseform.imageList && baseform.imageList.length>0'>
				<dt class="contain-title border-b-1"><span>资产发行结构图</span></dt>
				<div class='contain-main'>
					<img :src='imgsrc'  alt='产品结构图' style="max-width: 100%;">
				</div> 
			</div>
			<div class='contain mt15'  v-if='baseform.fileVOList && baseform.fileVOList.length>0'>
				<dt class="contain-title border-b-1"><span>相关资料</span></dt>
				<ul class='contain-main ft12 fileList '>
					<li  v-for='item in baseform.fileVOList'  @click='downloadFile(item.code)'>{{item.name}}</li>
				</ul>
			</div> 
		</a-spin>
	</div>
</template>

<script >
	import titleCommon from '@/components/titleCommon'
	import { propertyDetail }  from  '@/api/home/index'
	export default{
		name:'propertyDetail',
		data(){
			return {
				indicator: <a-icon type="loading" style="font-size: 24px" spin />,
				spinning:false,

				baseform:{},
				productTagData:[],
				imgsrc:process.env.BASE_API+'/op/fileupload/download_file?token='+sessionStorage.getItem('tokenId')+'&fileCode=',//返回流程图
			}
		},
		created(){
			let code  = this.$route.query.code
			this.pageInit(code)
		},
		methods:{
			pageInit(code){
				this.spinning = true
				propertyDetail(code).then((res)=>{
						if(res.data.flag == true){
							this.baseform = res.data.data
 
	  						//返回流程图
	  						if(this.baseform.imageList && this.baseform.imageList.length>0){
	  							this.imgsrc+=this.baseform.imageList[0].code
	  						}
	                    	
						}
						this.spinning = false
				})
				.catch((err)=>{
					this.spinning = false
				})
			},
			changeTag(str){
				this.productTagData = str.slice(0,-1).split(',') 
			},
		},
		components:{
			titleCommon
		}
	}
</script>

<style scoped="scoped">
.tagList li{float: left;padding: 0.06rem 0.15rem;margin:0.1rem 0.25rem 0 0;background-color: #D6E3FF;color: #1E49A5;border-radius: 0.12rem;}	
</style>